|
|
|
|
|
|
|
Day 16
Database Normalization |
|
|
|
|
|
|
|
|
In Day 16's lesson, you learned how to improve database integrity and access speed using the five rules of data normalization. You learned the following five rules: |
|
|
|
|
|
|
|
|
· Rule 1: Eliminate repeating groups. If you have a set of fields that have the same name followed by a number (Skill1, Skill2, Skill3, and so forth), remove these repeating groups, create a new table for the repeating data, and relate it to the key field in the first table. |
|
|
|
|
|
|
|
|
· Rule 2: Eliminate redundant data. Don't store the same data in two different locations. This can lead to update and delete errors. If equivalent data elements are entered in two fields, remove the second data element, create a new master table with the element and its partner as a key field, and then place the key field as a relationship in the locations that formerly held both data elements. |
|
|
|
|
|
|
|
|
· Rule 3: Eliminate columns not dependent on keys. If you have data elements that are not directly related to the primary key of the table, these elements should be removed to their own data table. Only store data elements that are directly related to the primary key of the table. This particularly includes derived data or other calculations. |
|
|
|
|
|
|
|
|
· Rule 4: Isolate independent multiple relationships. Use this rule to improve database design when you are dealing with more than one one-to-many relationship in the database. Before you add a new field to a table, ask yourself whether this field is really dependent upon the other fields in the table. If not, create a new table with the independent data. |
|
|
|
|
|
|
|
|
· Rule 5: Isolate related multiple relationships. Use this rule to improve database design when you are dealing with more than one many-to-many relationship in the database. If you have database rules that require multiple references to the same field or sets of fields, isolate the fields into smaller tables and construct one or more link tables that contain the required constraints that enforce database integrity. |
|
|
|
|
|
|
|
|
Day 17
Multiuser Considerations |
|
|
|
|
|
|
|
|
On Day 17, you learned about the three important challenges that face every database programmer writing multiuser applications: |
|
|
|
|
|
|
|
|
· Database locking schemes |
|
|
|
|
|
|
|
|
· Using cascading updates and deletes to maintain database integrity |
|
|
|
|
|
|
|
|
· Using database transactions to provide commit/rollback options for major updates to your database |
|
|
|
|
|